package com.neusoft.demo.controller;

import com.neusoft.demo.pojo.User;
import com.neusoft.demo.server.UserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@CrossOrigin
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserServer userServer;
    @ResponseBody
    @RequestMapping("login")
    public User userLogin(String userName,String password){
        return userServer.UserLogin(userName, password);
    }
    @ResponseBody
    @RequestMapping("add")
    public boolean addUser(User user){
        return  userServer.addUser(user);
    }
}
